package ext.db;

import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;


public class DbHelper extends JdbcTemplate{
	
	public static DataSource dataSource;

	public DbHelper(){
		if(dataSource != null){
			super.setDataSource(dataSource);
		}
	}
	
	public DbHelper(DataSource dataSource){
		super(dataSource);
	}
	
	@Override
	public void setDataSource(DataSource dataSource) {
		DbHelper.dataSource = dataSource;
		super.setDataSource(dataSource);
	}
	
	@Override
	public DataSource getDataSource() {
		return super.getDataSource();
	}
	
}
